import type { PaginationProps } from '@/components/Table/src/types/pagination';
import type { ComputedRef } from 'vue';
import type { AdTableProps } from '../types/adTable';

import { useColumns } from '@/components/Table/src/hooks/useColumns';

export function useAdColumns(
  propsRef: ComputedRef<AdTableProps>,
  getPaginationRef: ComputedRef<boolean | PaginationProps>,
) {
  const {
    getColumnsRef,
    getCacheColumns,
    getColumns,
    setColumns,
    setColumnWidth,
    getViewColumns,
    setCacheColumnsByField,
    setCacheColumns,
  } = useColumns(propsRef, getPaginationRef);

  return {
    getColumnsRef,
    getCacheColumns,
    getColumns,
    setColumns,
    setColumnWidth,
    getViewColumns,
    setCacheColumnsByField,
    setCacheColumns,
  };
}

// format cell
export { formatCell } from '@/components/Table/src/hooks/useColumns';
